<?php
namespace Admin\Model;
use Think\Model;

class StaffModel extends Model{ 
  
    
    protected $_auto=array(
        array('time','date',1,'function','Y-m-d H:i:s'),
    );
    
    public function getstaffinfo(){
        $staffinfo=$this->create();      
        if($this->add($staffinfo)){
            return true;
        }else {
            return false;
        }
    }
    
//     public function trimall($str)//删除空格
//     {
//         $qian=array(" ","　","\t","\n","\r");$hou=array("","","","","");
//         return str_replace($qian,$hou,$str);
//     }
    
    public function getid(){
        $where['id']=I('get.id');
        return $this->where($where)->find();
    }
    
    public function updatestaff(){
        $staffinfo=$this->create();
        if($this->save($staffinfo)){
            return true;
        }else {
            return false;
        }
    }
    
    public function delid(){
        $where['id']=I('get.id');
        return $this->where($where)->delete();
    }
    
  
}